﻿using System.Web.Mvc;
using Zinnia.Core.Web.MVC.Exceptions;

namespace Zinnia.Core.Web.MVC.ViewModels
{
    public partial class ActionForm
    {
        /// <summary>
        /// 请求模型执行前（请求数据的验证工作）
        /// </summary>
        public virtual void OnRequestFormExecuted()
        {
        }

        /// <summary>
        /// 请求模型执行中...（根据请求的模型，执行相应的业务逻辑）
        /// </summary>
        public virtual void OnRequestFormExecuting()
        {
        }
        /// <summary>
        /// 返回视图模型执行前
        /// </summary>
        public virtual void OnResultExecuted()
        {
        }
        /// <summary>
        /// 返回视图模型执行中
        /// </summary>
        public virtual void OnResultExecuting()
        {
        }
        /// <summary>
        /// 重写ActionForm的业务逻辑
        /// </summary>
        /// <returns></returns>
        public virtual ActionResult ActionFromReset()
        {
            throw new ActionFormException();
        }
    }
}
